import { GaRegExp, ruleInject, ruleInjectable } from "../InjectionRule";
import { blankRemove } from "../methods/blank-remove";

@ruleInjectable()
export default class variableCreatedlRule extends GaRegExp {

	@ruleInject() private variableDataRule!: GaRegExp;

	@ruleInject() private calcRule!: GaRegExp;

	@ruleInject() private typeCalcRule!: GaRegExp;

	public RuleInit() {
		this.ParseRule([
			this.Supply("VAR_CREATED"),
			"(&(!const|var|final|let|static|bind)", "\\s", blankRemove, ")?",
			this.variableDataRule, blankRemove,
			"(&", ":", blankRemove, this.typeCalcRule, blankRemove, ")?",
			"(!=|\\+=|\\-=|\\*=|/=|%=|>>=|<<=|&=|^=|\\|=)", blankRemove,
			"(", this.calcRule, ")",
		]);
	}

}
